<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>代理城市设置</title>
    <!-- Le styles -->
    <link href="/common/js/bootstrap-3.0.0/css/bootstrap-united.min.css" rel="stylesheet">
    <style type="text/css">
        body {
            padding: 10px 0;
        }
    </style>
</head>
<body>
<div class="container">

    <div class="col-md-12 text-right" style="margin:10px 0;">
        <a style="width: 80px;" href="/user/addAgentCityView" class="btn btn-success">添加城市</a>
    </div>

        <table id="resultTable" class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>编号</th>
                <th>加盟商</th>
                <th>省/直辖市</th>
                <th>城市/区</th>
                <th>操作时间</th>
            </tr>
            </thead>
            <tbody>
            <script type="text/html">
                <tr>
                    <td>{{id}}</td>
                    <td>{{user.cnName}}</td>
                    <td>{{province}}</td>
                    <td>{{city}}</td>
                    <td>{{createTime?parseDate}}</td>
                    <#--<td>{{openType}}</td>-->
                    <#--<td><a style="width: 80px;" href="/user/editOpenCityView?id={{id}}" class="btn btn-success">编辑</a></td>-->
                </tr>
            </script>
            </tbody>
        </table>
</div>
<script type="text/javascript" src="/common/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/common/js/bootstrap-table.20130913.js"></script>
<script type="text/javascript" src="/common/js/dateformat.js"></script>
<script type="text/javascript" src="/common/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
    $(function () {
        var param = $("#form").serialize();
        var s = $("#resultTable").bsTable({
            url: '/user/getAgentCityList.json',
            ajaxType: "POST",  //ajax 提交方式 post 或者 get
            pageNo: 1,
            pageNoAlias: 'page',
            pageSize: 10,
            pageSizeAlias: 'pageSize',
            pagingAlign: "right",
            param: param,
            countRoot: "total",
            dataRoot: "list"
        });

        $("#searchBtn").on('click', function () {
            var param = $("#form").serialize();
            s.reload(param);
        });

//        window.onresize = function () {
//            window.top.autoIFrame();
//        }
    });

    function renderImg(imgUrl) {
        return "<img src=\"http://img.boyitongcheng.com/"+imgUrl+"\" width=\"60px\" height=\"40px\"/>";
    }

    function renderStatus(status) {
        if (status == -1) {
            return "删除";
        } else {
            return "启用";
        }
    }

    function renderAuthType(authType) {
        if (authType == 1) {
            return "平台认证";
        } else if(authType == 2) {
            return "诚信认证";
        }else{
            return "学院认证";
        }
    }
</script>
</body>
</html>